package com.example.demo5072.pojo;


import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

@Data
@AllArgsConstructor //生成全参构造函数
@NoArgsConstructor  //生成无参构造函数
public class WebResult<T> implements Serializable {

    private static final long serialVersionUID = 1L;


    /**
     * 失败消息
     */
    private String message;

    /**
     * 返回代码
     */
    private String detailMessage;


    /**
     * 结果对象
     */
    private T result;



    public WebResult(String message,String detailMessage) {
        this.message = message;
        this.detailMessage = detailMessage;
    }

    public static <T> WebResult<T> newInstance() {
        return new WebResult<>();
    }
}
